const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const router = require('./router');

app.use('/www', express.static('public'));

// (API) : http://www.expressjs.com.cn/4x/api.html#req.body
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded

app.use(router);

app.listen(3000, ()=>{
    console.log('running ...');
});
